package com.weme.common.util

import android.util.Log

object ExecutionTimeLogger {

    private var startTime: Long = 0
    private var endTime: Long = 0

    /**
     * 记录开始时间
     */
    fun start() {
        startTime = System.currentTimeMillis()
    }

    /**
     * 记录结束时间并计算执行时间
     * @param tag 用于日志的标记
     */
    fun end(tag: String) {
        endTime = System.currentTimeMillis()
        val executionTime = endTime - startTime
        Log.d(tag, "Execution time: $executionTime ms")
    }
}
